package com.zzyl.service.impl;

import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.zzyl.base.PageResponse;
import com.zzyl.mapper.AlertDataMapper;
import com.zzyl.service.AlertDataService;
import com.zzyl.vo.AlertDataVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @Description AlertDataServiceImpl
 * @Author liujiangyuan
 * @Date 2024-11-04-16:27
 */
@Service
public class AlertDataServiceImpl implements AlertDataService {
    @Autowired
    private AlertDataMapper alertDataMapper;

    @Override
    public PageResponse<AlertDataVo> getAlertDataPage(Integer pageNum,
                                                      Integer pageSize,
                                                      String deviceName,
                                                      Integer endTime,
                                                      Integer id,
                                                      Integer startTime,
                                                      Integer status) {
        PageHelper.startPage(pageNum,pageSize);
        Page<AlertDataVo> alertDataPage =
                alertDataMapper.getAlertDataPage(deviceName,endTime,id,startTime,status);

        return PageResponse.of(alertDataPage,AlertDataVo.class);
    }

    @Override
    public void handleAlertData(Integer id) {

    }
}
